import logging

from settings import Config


def get_logger(log_object, log_path):
    logger = logging.getLogger(log_object)
    logger.setLevel(logging.INFO)
    handler = logging.FileHandler(log_path)

    handler.setLevel(logging.WARNING)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    return logger

# logger.info('Starting print log')
# logger.debug('Do something')
# logger.warning('Something maybe failed.')
# logger.info('Finished')